{% if messages %}
    {% for message in messages %}
    <div class="alert {% if message.tags %}alert-{{ message.tags }}{% else %}alert-secondary{% endif %}
        alert-dismissible fade show" role="alert">
        {{ message }}
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
    </div>
    {% endfor %}
{% endif %}